const express = require("express")
const route = express.Router()

//引入权限控制校验中间件
const isLoginMiddel = require("../middleware/isLoginMiddel")

//引入数据库集合
const adminModel = require("../db/model/adminModel")
route.get("/adminList",isLoginMiddel,async (req, res) => {
    try {
        const findResult = await adminModel.find({},{
            password:0
        })
        res.send({
            "code": 10000,
            "msg": "查询成功",
            "data": findResult
        })
    } catch (e) {
        res.send({
            "code": 10001,
            "msg": "查询失败"+e.message,
            "data":null
        })
    }
})

module.exports = route